import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class ${entityName}ServiceImpl extends BaseServiceImpl implements ${entityName}Service {

	@Autowired
	private ${entityName}Dao ${lowerEntityName}Dao;

	@Override
	public DataPage<${me.dtoInfo.className}> showPageData(HttpServletRequest request) {
		Map<String, Object> map = new HashMap<>();
		// map.put("paramTransportId", paramTransportId);
		// 前端分页参数
		map.putAll(getPageMap(request));
		List<${me.dtoInfo.className}> list = ${lowerEntityName}Dao.queryBySql(map);
		int total = ${lowerEntityName}Dao.countBySql(map);
		DataPage<${me.dtoInfo.className}> data = new DataPage<>();
		data.setData(list);
		data.setTotal(total);
		return data;
	}

	@Override
	public ${me.dtoInfo.className} load(Integer id) {
		if (null != id && 0 < id) {
		return ${lowerEntityName}Dao.loadById(id);
		}
		return null;
	}

	@Override
	public ${me.dtoInfo.className} save(${me.dtoInfo.className} dto) {
		if (dto.getId() != null) {
			${lowerEntityName}Dao.updateByPrimaryKey(dto);
			return dto;
		} else {
			${lowerEntityName}Dao.insertSelective(dto);
			return dto;
		}
	}


	@Override
	public Integer delete(String id) {
		Map<String, Object> map = new HashMap<>();
		map.put("id", id.split(","));
		int result = ${lowerEntityName}Dao.delete(map);
		return result;
	}

}